/**
 * 
 * ROLL PANE VIEW
 * 
 * @Ning
 * 
 * 2009-2-21
 * 
 * */
package com.components.rollpane
{
	import core.section.Controller;
	
	import flash.display.DisplayObject;
	import flash.display.MovieClip;
	import flash.display.Sprite;

	public class RollPaneView extends Controller
	{
		//START...
		
		
		//PROPERTY...
		
		private var container:Sprite;
		
		private var content:DisplayObject;
		
		internal var btnLeader:MovieClip;
		
		
		//CONSTRUCTOR...
		public function RollPaneView(target:DisplayObject)
		{
			super(target);
			
			init();
			
		}
		
		//METHODS...
		
		//initializing...
		private function init():void
		{
		
			var target:Sprite = this.target as Sprite;
			
			container = target.getChildByName("container") as Sprite;
			
			container.visible = false;
			
			btnLeader = target.getChildByName("btnLeader") as MovieClip;
		
		}
		
		// show view...
		internal function show():void
		{
			
			container.visible = true;
			
		}
		
		
		// hide view...
		internal function hide():void
		{
			
			container.visible = false;
			
		}
		
		// add content...
		internal function addContent(content:DisplayObject):void
		{
			
			if(container.numChildren > 0) container.removeChildAt(0);
			
			container.addChild(content);
			
			this.content = content;
			
		}
		
		
		//END...
	}
}